package solutions.leetcode.easy;

import solutions.lib.BaseSolution;
import solutions.lib.TreeNode;

/**
 * @author lizhidong
 * <a href="https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/">104. 二叉树的最大深度</a>
 */
public class Solution104 extends BaseSolution {

    public int maxDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }
        return Math.max(maxDepth(root.left), maxDepth(root.right)) + 1;
    }

    public static void main(String[] args) {
        Solution104 solution = new Solution104();
    }
}